package com.example.serverdemo.bean.json.device;

import com.example.serverdemo.bean.DeviceInfoBean;

import java.util.List;

public class Format {
    private List<Integer> Id;
    private int address;
    private int type;
    private String version;
    private String name;
    public void setId(List<Integer> Id) {
        this.Id = Id;
    }
    public List<Integer> getId() {
        return Id;
    }

    public void setAddress(int address) {
        this.address = address;
    }
    public int getAddress() {
        return address;
    }

    public void setType(int type) {
        this.type = type;
    }
    public int getType() {
        return type;
    }

    public void setVersion(String version) {
        this.version = version;
    }
    public String getVersion() {
        return version;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getName() {
        return name;
    }

    public DeviceInfoBean toDeviceInfoBean(){
        DeviceInfoBean deviceInfoBean = new DeviceInfoBean();
        String id = "";
        for(int i = 0;i < this.Id.size();i++){
            id = id + this.Id.get(i);
        }
        deviceInfoBean.setDeviceId(id);
        deviceInfoBean.setDeviceAddress(this.address);
        deviceInfoBean.setDeviceTypeId(this.type);
        deviceInfoBean.setDeviceName(this.name);
        deviceInfoBean.setDeviceFirmwareVersion(this.version);
        return deviceInfoBean;
    }
}
